"""Build versioned extent allocator"""
import os

def scons():
    """Execute build"""
    Import('env', 'prereqs')

    env.AppendUnique(LIBPATH=[Dir('.')])

    if not prereqs.server_requested():
        return

    denv = env.Clone()
    prereqs.require(denv, 'pmdk')

    denv.Append(CPPDEFINES=['-DDAOS_PMEM_BUILD'])
    denv.Library('vea', Glob('*.c'), LIBS=['daos_common_pmem', 'gurt'])

    if prereqs.test_requested():
        SConscript('tests/SConscript', exports='denv')

if __name__ == "SCons.Script":
    scons()
